package com.example.administrator.videotest2.util.Tab;

import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.example.administrator.videotest2.R;

public class MyAdapter extends RecyclerView.Adapter {
    TextView iconName;
    String data[]={"111","222","333","444","555"};

    static class ViewHolder extends RecyclerView.ViewHolder{
        TextView iconName;

        public ViewHolder(View view){
            super(view);
            iconName = (TextView) view.findViewById(R.id.icon_name);
        }
    }

    @Override
    public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {

        View view = LayoutInflater.from(parent.getContext())
                .inflate(R.layout.item,parent,false);
        ViewHolder holder = new ViewHolder(view);
        return holder;
    }

    @Override
    public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) {

        iconName.setText(data[position]);

    }

    @Override
    public int getItemCount() {

       return data.length;
    }
}